// Agent contestant in project COMP667-Proj

/* Initial beliefs and rules */
plays(user,_username).
plays(host,_hostname).
question(_Questionid,_Questiontext,_CorrectAnswer,_Answer1,_Answer2,_Answer3,_Answer4,_Difficulty,_Fieldname,_Learningobjecttype).
/* Initial goals */

// send a message to the initiator introducing myself as a contestant
+plays(user,In):true
	//set the variable Me with my name, i.e. contestant1
   <- .my_name(Me);
   	//introduce self to the user as a contestant
    .send(In,tell,introduction(contestant,Me));
    .print("introducing myself:", Me, " to ",In).
 
// send a message to the initiator introducing myself as a contestant
+plays(host,In):true
	//set the variable Me with my name, i.e. contestant1
   <- .my_name(Me);
   	//introduce self to the user as a contestant
    .send(In,tell,introduction(contestant,Me));
    .print("introducing myself:", Me, " to ",In);
    //ready to answer questions
    !answer_questions.

+!answer_questions:true
<-?question(Questionid,Questiontext,CorrectAnswer,Answer1,Answer2,Answer3,Answer4,Difficulty,Fieldname,Learningobjecttype);
?plays(host,A);
 .send(A,tell,question_answer(Questionid,Answer));
 .print("received question from ", A).